Optimal. Leaf size=202 \[ -\frac{x \left (a+b x^n\right )^p \left (\frac{b x^n}{a}+1\right )^{-p} (b c (n p+n+1) (a d-b c (n (p+2)+1))-a d (a d (n+1)-b c (n (p+3)+1))) \, _2F_1\left (\frac{1}{n},-p;1+\frac{1}{n};-\frac{b x^n}{a}\right )}{b^2 (n p+n+1) (n (p+2)+1)}-\frac{d x \left (a+b x^n\right )^{p+1} (a d (n+1)-b c (n (p+3)+1))}{b^2 (n p+n+1) (n (p+2)+1)}+\frac{d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n p+2 n+1)} \]
[Out]
_______________________________________________________________________________________
Rubi [A] time = 0.624457, antiderivative size = 197, normalized size of antiderivative = 0.98, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21 \[ -\frac{d x \left (a+b x^n\right )^{p+1} (a d (n+1)-b (c n (p+3)+c))}{b^2 (n p+n+1) (n (p+2)+1)}-\frac{x \left (a+b x^n\right )^p \left (\frac{b x^n}{a}+1\right )^{-p} \left (c (a d-b (c n (p+2)+c))-\frac{a d (a d (n+1)-b (c n (p+3)+c))}{b (n p+n+1)}\right ) \, _2F_1\left (\frac{1}{n},-p;1+\frac{1}{n};-\frac{b x^n}{a}\right )}{b (n (p+2)+1)}+\frac{d x \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{b (n (p+2)+1)} \]
Antiderivative was successfully verified.
[In] Int[(a + b*x^n)^p*(c + d*x^n)^2,x]
[Out]
_______________________________________________________________________________________
Rubi in Sympy [A] time = 36.2797, size = 173, normalized size = 0.86 \[ \frac{d x \left (a + b x^{n}\right )^{p + 1} \left (c + d x^{n}\right )}{b \left (n \left (p + 2\right ) + 1\right )} - \frac{d x \left (a + b x^{n}\right )^{p + 1} \left (a d \left (n + 1\right ) - b c \left (n \left (p + 3\right ) + 1\right )\right )}{b^{2} \left (n \left (p + 1\right ) + 1\right ) \left (n \left (p + 2\right ) + 1\right )} + \frac{x \left (1 + \frac{b x^{n}}{a}\right )^{- p} \left (a + b x^{n}\right )^{p} \left (a d \left (a d \left (n + 1\right ) - b c \left (n \left (p + 3\right ) + 1\right )\right ) - b c \left (a d - b c \left (n \left (p + 2\right ) + 1\right )\right ) \left (n \left (p + 1\right ) + 1\right )\right ){{}_{2}F_{1}\left (\begin{matrix} - p, \frac{1}{n} \\ 1 + \frac{1}{n} \end{matrix}\middle |{- \frac{b x^{n}}{a}} \right )}}{b^{2} \left (n \left (p + 1\right ) + 1\right ) \left (n \left (p + 2\right ) + 1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] rubi_integrate((a+b*x**n)**p*(c+d*x**n)**2,x)
[Out]
_______________________________________________________________________________________
Mathematica [A] time = 0.24786, size = 140, normalized size = 0.69 \[ \frac{x \left (a+b x^n\right )^p \left (\frac{b x^n}{a}+1\right )^{-p} \left ((n+1) \left (c^2 (2 n+1) \, _2F_1\left (\frac{1}{n},-p;1+\frac{1}{n};-\frac{b x^n}{a}\right )+d^2 x^{2 n} \, _2F_1\left (2+\frac{1}{n},-p;3+\frac{1}{n};-\frac{b x^n}{a}\right )\right )+2 c d (2 n+1) x^n \, _2F_1\left (1+\frac{1}{n},-p;2+\frac{1}{n};-\frac{b x^n}{a}\right )\right )}{(n+1) (2 n+1)} \]
Antiderivative was successfully verified.
[In] Integrate[(a + b*x^n)^p*(c + d*x^n)^2,x]
[Out]
_______________________________________________________________________________________
Maple [F] time = 0.137, size = 0, normalized size = 0. \[ \int \left ( a+b{x}^{n} \right ) ^{p} \left ( c+d{x}^{n} \right ) ^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In] int((a+b*x^n)^p*(c+d*x^n)^2,x)
[Out]
_______________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \[ \int{\left (d x^{n} + c\right )}^{2}{\left (b x^{n} + a\right )}^{p}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((d*x^n + c)^2*(b*x^n + a)^p,x, algorithm="maxima")
[Out]
_______________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \[{\rm integral}\left ({\left (d^{2} x^{2 \, n} + 2 \, c d x^{n} + c^{2}\right )}{\left (b x^{n} + a\right )}^{p}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((d*x^n + c)^2*(b*x^n + a)^p,x, algorithm="fricas")
[Out]
_______________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((a+b*x**n)**p*(c+d*x**n)**2,x)
[Out]
_______________________________________________________________________________________
GIAC/XCAS [F(-2)] time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate((d*x^n + c)^2*(b*x^n + a)^p,x, algorithm="giac")
[Out]